﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace 聚欣订单分析
{
    public partial class DataExpire : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Page.Title = " 订单分析系统";
            }
            if (Session["qx"] == null)
            {
                Response.Redirect("login.aspx");
            }
            if (Session["qx"].ToString() == "0")
            {
                this.SqlDataSource1.SelectCommand = "SELECT * FROM [tbl_DDB] where 维保时间<GETDATE() and 订单取消='否'";
            }
            else
            {
                string strWhere = "省 in('" + Session["Qy"].ToString().Replace(",", "','") + "')";
                this.SqlDataSource1.SelectCommand = "SELECT * FROM [tbl_DDB] where 维保时间<GETDATE() and 订单取消='否' and " + strWhere;
            }
        }

        protected void btnExcel_Click(object sender, EventArgs e)
        {
            ASPxGridViewExporter1.WriteXlsxToResponse("DataExpire");
        }
    }
}
